//
//  EduExpTableViewCell.m
//  CYWFrame
//
//  Created by 于顺燊 on 2018/9/19.
//  Copyright © 2018年 Macx. All rights reserved.
//

#import "EduExpTableViewCell.h"

@implementation EduExpTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setInfo:(NSDictionary *)info
{
	NSString *startTimeStr = info[@"start_time"];
	self.startDate.text = @"";
	if (startTimeStr.length >= 8) {
		NSString *yearStr = [startTimeStr substringWithRange:NSMakeRange(0, 4)];
		NSString *monthStr = [startTimeStr substringWithRange:NSMakeRange(4, 2)];
		NSString *dayStr = [startTimeStr substringWithRange:NSMakeRange(6, 2)];
		self.startDate.text = [NSString stringWithFormat:@"%@年%@月%@日", yearStr, monthStr, dayStr];
	}
	
	NSString *endTimeStr = info[@"end_time"];
	self.endDate.text = @"";
	if (endTimeStr.length >= 8) {
		NSString *yearStr2 = [endTimeStr substringWithRange:NSMakeRange(0, 4)];
		NSString *monthStr2 = [endTimeStr substringWithRange:NSMakeRange(4, 2)];
		NSString *dayStr2 = [endTimeStr substringWithRange:NSMakeRange(6, 2)];
		self.endDate.text = [NSString stringWithFormat:@"%@年%@月%@日", yearStr2, monthStr2, dayStr2];
	}
	self.degree.text = info[@"education"];
	self.university.text = info[@"title"];
	self.major.text = info[@"major"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
